<?php
namespace Admin\Model;

use Think\Model;

class UserModel extends Model
{
    protected $tableName = 'user';

    protected $_validate = [
        ['email', 'email', '邮箱格式不正确！'],
        ['email', '', '邮箱地址已经存在', 0, 'unique', 1], //1代表添时校验
        ['user_name', '', '用户名已经存在', 0, 'unique', 1]
    ];

    protected $_auto = [
        ['pass_word', 'md5', 3, 'function'], //添加与编辑时自动套用md5
    ];


}